<?php

// --------- Dashboard
Router::connect(
    '/admin',
    array(
        'admin' => true,
        'controller' => 'admin',
        'action' => 'index'
    )
);

// --------- Product Category
Router::connect(
    '/admin/category',
    array(
        'admin' => true,
        'controller' => 'adminProductcategories',
        'action' => 'index'
    )
);

Router::connect(
    '/admin/category-:page',
    array(
        'admin' => true,
        'controller' => 'adminProductcategories',
        'action' => 'index'
    ),
    array(
        'page' => '[0-9]+'
    )
);

Router::connect(
    '/admin/category/add',
    array(
        'admin' => true,
        'controller' => 'adminProductcategories',
        'action' => 'add'
    )
);

Router::connect(
    '/admin/category/edit',
    array(
        'admin' => true,
        'controller' => 'adminProductcategories',
        'action' => 'edit'
    )
);

Router::connect(
    '/admin/category/delete',
    array(
        'admin' => true,
        'controller' => 'adminProductcategories',
        'action' => 'delete'
    )
);


// --------- Product Category
Router::connect(
    '/admin/product',
    array(
        'admin' => true,
        'controller' => 'adminProducts',
        'action' => 'index'
    )
);

Router::connect(
    '/admin/product-:page',
    array(
        'admin' => true,
        'controller' => 'adminProducts',
        'action' => 'index'
    ),
    array(
        'page' => '[0-9]+'
    )
);

Router::connect(
    '/admin/product/add',
    array(
        'admin' => true,
        'controller' => 'adminProducts',
        'action' => 'add'
    )
);

Router::connect(
    '/admin/product/edit',
    array(
        'admin' => true,
        'controller' => 'adminProducts',
        'action' => 'edit'
    )
);

Router::connect(
    '/admin/product/delete',
    array(
        'admin' => true,
        'controller' => 'adminProducts',
        'action' => 'delete'
    )
);


// --------- User
Router::connect(
    '/admin/user',
    array(
        'admin' => true,
        'controller' => 'adminUser',
        'action' => 'index'
    )
);

Router::connect(
    '/admin/user-:page',
    array(
        'admin' => true,
        'controller' => 'adminUser',
        'action' => 'index'
    ),
    array(
        'page' => '[0-9]+'
    )
);

Router::connect(
    '/admin/user/add',
    array(
        'admin' => true,
        'controller' => 'adminUser',
        'action' => 'add'
    )
);

Router::connect(
    '/admin/user/edit',
    array(
        'admin' => true,
        'controller' => 'adminUser',
        'action' => 'edit'
    )
);

Router::connect(
    '/admin/user/delete',
    array(
        'admin' => true,
        'controller' => 'adminUser',
        'action' => 'delete'
    )
);

Router::connect(
    '/admin/user/profile',
    array(
        'admin' => true,
        'controller' => 'adminUser',
        'action' => 'profile'
    )
);

Router::connect(
    '/admin/user/change-password',
    array(
        'admin' => true,
        'controller' => 'adminUser',
        'action' => 'changePassword'
    )
);


// --------- Auth
Router::connect(
    '/admin/login',
    array(
        'admin' => true,
        'controller' => 'admin',
        'action' => 'login'
    )
);

Router::connect(
    '/admin/logout',
    array(
        'admin' => true,
        'controller' => 'admin',
        'action' => 'logout'
    )
);